{% extends "admin/layout.html" %}
{% block title %} 模板安装 {% endblock %}
{% set media_active = 'active' %}

{% block header %}
<link href="/static/admin/swfupload/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/static/admin/swfupload/swfupload.js"></script>
<script type="text/javascript" src="/static/admin/swfupload/js/swfupload.swfobject.js"></script>
<script type="text/javascript" src="/static/admin/swfupload/js/swfupload.queue.js"></script>
<script type="text/javascript" src="/static/admin/swfupload/js/fileprogress.js"></script>
<script type="text/javascript" src="/static/admin/swfupload/js/handlers.js"></script>
<script type="text/javascript">
var swfu;

SWFUpload.onload = function () {
	var settings = {
		flash_url : "/static/admin/swfupload/swfupload.swf",
		upload_url: "{{ upload_url }}",
		post_params: {
			"PHPSESSID" : "NONE",
			"HELLO-WORLD" : "Here I Am",
			".what" : "OKAY"
		},
		file_size_limit : "50 MB",
		file_types : "*.*",
		file_types_description : "All Files",
		file_upload_limit : 100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress",
			cancelButtonId : "btnCancel"
		},
		debug: true,

		// Button Settings
		button_image_url : "/static/admin/swfupload/XPButtonUploadText_61x22.png",
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 61,
		button_height: 22,

		// The event handler functions are defined in handlers.js
		swfupload_loaded_handler : swfUploadLoaded,
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		queue_complete_handler : queueComplete,	// Queue plugin event
		
		// SWFObject settings
		minimum_flash_version : "9.0.28",
		swfupload_pre_load_handler : swfUploadPreLoad,
		swfupload_load_failed_handler : swfUploadLoadFailed
	};

	swfu = new SWFUpload(settings);
}
</script>
{% endblock %}

{% block content %}
<div id="containerHolder">
  <div id="container">
    <div id="sidebar">
      <ul class="sideNav">
        <li><a href="/admin/media">媒体管理</a></li>
        <li><a href="/admin/media/upload" class="active">媒体上传</a></li>
      </ul>
    </div>

    <!-- h2 stays for breadcrumbs -->
    <h2><a href="/admin">Dashboard</a> &raquo; <a href="/admin/media/upload" class="active">媒体上传</a></h2>

    <div id="main">
      <h3>媒体上传</h3>
      
    	<form action="" method="post" enctype="multipart/form-data">
        <div id="divSWFUploadUI">
    			<div class="fieldset  flash" id="fsUploadProgress">
    			<span class="legend">Upload Queue</span>
    			</div>
    			<p id="divStatus">0 Files Uploaded</p>
    			<p>
    				<span id="spanButtonPlaceholder"></span>
    				<input id="btnCancel" type="button" value="Cancel All Uploads" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />
    				<br />
    			</p>
    		</div>
      </form>

    </div>
    <div class="clear"></div>
  </div>
</div>
{% endblock %}
